//连接数据库
import mongoose from 'mongoose';

const MONGO_URI = 'mongodb://localhost:27017/risk_backend';

export const connectDB = async () => {
  try {
    await mongoose.connect(MONGO_URI); 
    console.log('MongoDB connected successfully');
  } catch (error) {
    console.error('MongoDB connection error:', error);
    process.exit(1);
  }
};